from mcp.server.fastmcp import FastMCP
from datetime import datetime


mcp = FastMCP(host='0.0.0.0', port=9876)


@mcp.tool()
async def current_time():
    """获取北京时间的当前时间"""
    now_time = datetime.now()
    return now_time.strftime('%Y-%m-%dT%H:%M:%S')


if __name__ == '__main__':
    mcp.run(transport='streamable-http')

